﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Web.System_Demo {

  public partial class ReflectionDemo : System.Web.UI.Page {

    protected void Page_Load(object sender, EventArgs e) {
      if (!IsPostBack) {
        Apple[] array = null;
        Type type = null;

        array = new Apple[] { 
          new Apple {
            Id = 1,
            Name = "Apple I"
          },
          new Apple {
            Id = 2,
            Name = "Apple II"
          },
          new Apple {
            Id = 3,
            Name = "PowerBook"
          }
        };

        type = array.GetType();

        if (type.IsArray) {
          Response.Write("Is array. type: " + type.ToString());
        }
        else {
          Response.Write("Is't array");
        }
      }
    }
  }

  public class Apple {

    public int Id { get; set; }
    public string Name { get; set; }
  }
}